#define _CRT_SECURE_NO_WARNINGS

#include "String.h"

namespace Mao
{
	void test1()
	{
		string str1;
		cout << str1.c_str() << endl;
		
		string str2("hello cat");
		cout << str2.size() << endl;
		//cout << str2[3] << endl;

		str2.push_back('c');
		str2.push_back('a');
		str2.push_back('t');
		cout << str2.c_str() << endl;
		for (auto e : str2)
		{
			cout << e << '-';
		}
		cout << endl;

		const string str3("hello");
		for (auto e : str3)
		{
			cout << e << '-';
		}
		cout << endl;
	}

	void test2()
	{

		/*string str1("hello cat");
		cout << str1.c_str() << endl;
		str1.appent("maomaomao");
		cout << str1 << endl;

		string str2("cat");
		str2 += "mao";
		str2 += "banzhang";
		cout << str2 << endl;

		string str3("maomao banzhang");
		str3.insert(6, 'V');
		cout << str3 << endl;
		str3.insert(7, "love");
		cout << str3 << endl;*/

		//string str4("maomao banzhang");
		string str4("abc d efg");
		str4.insert(9, "1234");
		cout << str4 << endl;
		str4.erase(7);
		cout << str4 << endl;
	}
}

int main()
{
	//Mao::test1();
	Mao::test2();


	return 0;
}